-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Add Basic and Bearer Authorization to the CPP Pistache generator #22337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…or HTTP Basic protected endpoints.
…on a struct instead of two std::strings
This allows for data ft be passed on from the authenticator to the handler implementation. For example a userid that has already been looked up
`api-base-source.mustache` contain implementations of security related methods and also the empty constructor.
|
thanks for the PR to fix the remaining issue in another PR. will review and get it merged |
|
did a quick test locally but got did you encounter similar issues locally? |
|
Yes, at first. I did not have GTEST installed but after installing GoogleTest and GoogleMock libraries I did not see this error. I did something similar to: Clone the repositorygit clone https://github.com/google/googletest.git Build and installcmake -S . -B build I got some "libevent" errors somewhere else and installed sudo apt-get update I am not sure if it is intended that these should be installed. Please let me know! |
This pull request continues the work from #19978 by @mowijo.
I’ve updated the branch, and resolved the remaining issues. I ran
mvn integration-test -f samples/server/petstore/cpp-pistache/pom.xmlwhich passed.Summary of changes:
Changed indentation levels for readability.
The integration test failed due to defines not being declared when calling the
'static_assert(HTTP_BASIC_AUTH_DEFINED + HTTP_BEARER_AUTH_DEFINED < 2, "Path '" REST_PATH "' has more than one security scheme specified, and the Pistache server generator does not support that.");'
Closes #19978
Thanks again to @mowijo for the initial contribution!
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)